import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import 'amfe-flexible'
// 导入全局组件并全局注册
import ArticleItem from './components/ArticleItem.vue'

// 引入vant组件
import { Form, Divider, Search, Row, Col, Badge, Popup, dialog, PullRefresh, ActionSheet, Field, List, Button, Cell, Tab, Tabs, Icon, NavBar, Notify, Tabbar, TabbarItem } from 'vant'
Vue.component('ArticleItem', ArticleItem)
Vue.use(Form)
Vue.use(Divider)
Vue.use(Search)
Vue.use(Row)
Vue.use(Col)
Vue.use(Badge)
Vue.use(Popup)
Vue.use(dialog)
Vue.use(PullRefresh)
Vue.use(ActionSheet)
Vue.use(List)
Vue.use(Field)
Vue.use(Button)
Vue.config.productionTip = false
Vue.use(NavBar)
Vue.use(Notify)
Vue.use(Tabbar)
Vue.use(TabbarItem)
Vue.use(Icon)
Vue.use(Tab)
Vue.use(Tabs)
Vue.use(Cell)
// 设置一个聚焦
Vue.directive('jujiao', {
  inserted (el) {
    el.focus()
  }
})
Vue.directive('fofo', {
  inserted (el) {
    // 指令在van-search组件身上, 获取的是组件根标签div, 而input在标签内
    el = el.querySelector('input')
    el.focus()
  }
})
new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
